package com.link2room.optimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by sss on 2016/9/1.
 */
@Entity
@Table(name = "marketing_campaigns_stock")
@DynamicInsert
public class MarketingCampaignsStock extends BaseEntity {
    public enum MarketingCampaignsStock_{
        mcdCode,rmtype,saleNum,soldNum,isClosed,rsvDate
    }

    public MarketingCampaignsStock(){

    }
    public MarketingCampaignsStock(String lhotelGroupCode,String lhotelCode,String mcdCode,String rmtype,Date rsvDate,Integer weekd,Integer setNum,String isClosed){
        setLhotelGroupCode(lhotelGroupCode);
        setLhotelCode(lhotelCode);
        setMcdCode(mcdCode);
        setRmtype(rmtype);
        setRsvDate(rsvDate);
        setWeekd(weekd);
        setSetNum(setNum);
        setIsClosed(isClosed);
    }
    /**
     * 活动代码
     */
    private String mcdCode;
    /**
     * 房型代码
     */
    private String rmtype;
    /**
     * 可售量
     */
    private Integer setNum;
    /**
     * 是否关房
     */
    private String isClosed;
    /**
     * 日期
     */
    private Date rsvDate;
    /**
     * 星期
     */
    private Integer weekd;


    @Basic
    @Column(name = "mcd_code", nullable = false, length = 64)
    public String getMcdCode() {
        return mcdCode;
    }

    public void setMcdCode(String mcdCode) {
        this.mcdCode = mcdCode;
    }

    @Basic
    @Column(name = "rmtype", nullable = false, length = 32)
    public String getRmtype() {
        return rmtype;
    }

    public void setRmtype(String rmtype) {
        this.rmtype = rmtype;
    }

    @Basic
    @Column(name = "set_num", nullable = true)
    public Integer getSetNum() {
        return setNum;
    }

    public void setSetNum(Integer setNum) {
        this.setNum = setNum;
    }

    @Basic
    @Column(name = "is_closed", nullable = false, length = 2)
    public String getIsClosed() {
        return isClosed;
    }

    public void setIsClosed(String isClosed) {
        this.isClosed = isClosed;
    }

    @Basic
    @Column(name = "rsv_date", nullable = false)
    public Date getRsvDate() {
        return rsvDate;
    }

    public void setRsvDate(Date rsvDate) {
        this.rsvDate = rsvDate;
    }

    @Basic
    @Column(name = "weekd", nullable = true)
    public Integer getWeekd() {
        return weekd;
    }

    public void setWeekd(Integer weekd) {
        this.weekd = weekd;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MarketingCampaignsStock that = (MarketingCampaignsStock) o;

        if (mcdCode != null ? !mcdCode.equals(that.mcdCode) : that.mcdCode != null) return false;
        if (rmtype != null ? !rmtype.equals(that.rmtype) : that.rmtype != null) return false;
        if (setNum != null ? !setNum.equals(that.setNum) : that.setNum != null) return false;
        if (isClosed != null ? !isClosed.equals(that.isClosed) : that.isClosed != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = mcdCode != null ? mcdCode.hashCode() : 0;
        result = 31 * result + (rmtype != null ? rmtype.hashCode() : 0);
        result = 31 * result + (setNum != null ? setNum.hashCode() : 0);
        result = 31 * result + (isClosed != null ? isClosed.hashCode() : 0);
        return result;
    }
}
